package com.gopay.bis.manager.bank.tpas.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.gopay.bis.dao.tpas.TpasOrderDAO;
import com.gopay.bis.manager.bank.tpas.TpasOrderManager;
import com.gopay.common.domain.bank.tpas.TpasOrder;

@Service("tpasOrderManager")
public class TpasOrderManagerImpl implements TpasOrderManager {

    @Resource(name = "tpasOrderDAO")
    private TpasOrderDAO tpasOrderDAO;
    @Override
    public List<TpasOrder> getTpasOrdersByGopayOrderId(String orderId) {
        List<TpasOrder> orders = tpasOrderDAO.getTpasOrdersByGopayOrderId(orderId);
        return orders;
    }
    @Override
    public TpasOrder addBankOrder(TpasOrder order) {
        return tpasOrderDAO.save(order);
    }
    @Override
    public TpasOrder getTpasOrderByCpOrderId(String outOrderId) {
        return tpasOrderDAO.find(TpasOrder.class, outOrderId);
    }
    @Override
    public int updateBackSuccess(String orderId) {
        return tpasOrderDAO.updateBackSuccess(orderId);
    }
    @Override
    public int updateBackFail(String orderId) {
        return tpasOrderDAO.updateBackFail(orderId);
    }
	@Override
	public int updateInAcctFail(String outOrderId, String status) {
		return tpasOrderDAO.updateInAcctFail(outOrderId, status); 
	}

}
